/*请求url*/
var urlData = require('../../../data/url.js');

Page({
  data:{
    userRole:0//老师：4 家长：5
  },
  /*
    页面加载
   */
  onLoad:function(e){
    var that = this;
    wx.getStorage({
      key : "loginConf",
      success : function(res){
        that.setData({
          userRole : res.data.userRole
        });
      }
    });
  },
    /*
    去到首页
  */
  toIndex:function(e){
    wx.navigateTo({
      url: '../../index/index'
    })
  },
  /*
    学校新闻
  */
  toNews:function(e){
    wx.navigateTo({
      url: '../home-school-manage/school-news/news-list/news-list'
    })
  },
  /*
    学校通知
  */
  toInform:function(e){
    wx.navigateTo({
      url: '../home-school-manage/school-notice/inform-list/inform-list'
    })
  },
  /*
    成绩查询
  */
  toScore:function(e){
    wx.navigateTo({
      url: '../../index/home-school-manage/score/score-query/score-query'
    })
  },
  /*
    社团选课
  */
  toSelectClass:function(e){
    wx.navigateTo({
      url: '../../index/organ-manage/select-class/select-class'
    });
  },
  /*
    社团考勤
  */
  toOrganCheck: function (e) {
    wx.navigateTo({
      url: '../../index/organ-manage/organ-check/check-page/check-page'
    });
  },
  /*
    社团作业
  */
  toOrganWork:function(e){
    wx.navigateTo({
      url: '../../index/organ-manage/organ-homework/organ-homework-list/organ-homework-list'
    });
  },
  /*
    社团档案
  */
  toOrganRecord:function(e){
  	wx.navigateTo({
      url: '../../index/organ-manage/organ-record/organ-record-list/organ-record-list'
    })
  },
  /*
    课程评价
  */
  toCourseEvaluate:function(e){
    wx.navigateTo({
      url: '../../index/organ-manage/course-evaluate/course-evaluate'
    })
  },
  /*
    老师评语
  */
  toTeacherComments:function(e){
    wx.navigateTo({
      url: '../../index/teaching-manage/teacher-comments/teacher-comments'
    })
  },
  /*
    请假管理
   */
  toLeaveManage:function(e){
    var role = this.data.userRole;
    if( role == 4 ){//老师角色跳页
      wx.navigateTo({
        url: '../../index/teaching-manage/leave-manage/leave-manage-select-teacher/leave-manage-select-teacher'
      })
    }else if( role == 5){
      wx.navigateTo({//家长角色跳页
        url: '../../index/teaching-manage/leave-manage/leave-manage-select-student/leave-manage-select-student'
      })
    }
  },
  /*
    班级课表
  */
  toClassSchedule:function(e){
    wx.navigateTo({//家长角色跳页
      url: '../../index/teaching-manage/class-schedule/class-schedule'
    })
  }
});